﻿using System.Globalization;
using System.Windows.Data;

namespace Super.Hmi.Converters
{
    /// <summary>
    /// RadioButton isCheked 转换器 适用枚举的多个RadioButton
    /// </summary>
    public class EnumToIsCheckedConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values == null || values.Length < 2) return false;
            var value1 = values[0]?.ToString();
            var value2 = values[1]?.ToString();
            return string.Equals(value1, value2);
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            return Array.Empty<object>(); // 返回空数组，避免报错
        }
    }
}
